public class TestHashCode {
    public static void main(String[] args) {
        Integer i1 = 1;
        Integer i2 = 1;
        System.out.println("i1.hashCode(): " + i1.hashCode() + (i1.hashCode() == i2.hashCode()));
        System.out.println(i1.equals(i2));

        //equals与hashCode
        //1. 如果2个对象相等, 则它们的hashcode值一定相等
        //2. 如果2个对象相等, 则他们进行equals()比较,一定返回true
        //3. 如果2个对象的hashcode相等,它们也不一定是相等的(hashcode是种散列算法, hashcode相等, 还要进行equals方法比较)

    }
}
